import request from '@/utils/request'

// 学科请求数据
export const getSubject = params => {
  return request({
    method: 'GET',
    url: '/subjects',
    params
  })
}
// 添加学科
export const addSubjects = data => {
  return request({
    method: 'POST',
    url: '/subjects',
    data
  })
}
// 学科详情
export const subjectDetails = id => {
  return request({
    method: 'GET',
    url: `/subjects/${id}`
  })
}
// 修改学科
export const changeSubjects = data => {
  return request({
    method: 'PUT',
    url: `/subjects/${data.id}`,
    data
  })
}
// 删除学科
export const deleteSubject = id => {
  return request({
    method: 'DELETE',
    url: `/subjects/${id}`
  })
}
